#include <stdio.h>
#include <sys/unistd.h>
#include <sys/stat.h>

/* CONST */
#define HAL_FILE_EOF        EOF
#define HAL_FILE_SEEK_SET   SEEK_SET
#define HAL_FILE_SEEK_CUR   SEEK_CUR
#define HAL_FILE_SEEK_END   SEEK_END

/* function */
#define halFileOpen(filename, mode)     fopen(filename, mode)
#define halFileClose(fp)                fclose(fp)
#define halFileReadLine(str, len, fp)   fgets(str, len, fp)
#define halFileRead(str, size, num, fp) fread(str, size, num, fp)
#define halFileWrite(str, fp)           fputs(str, fp)
#define halFileRemove(filename)         remove(filename)
#define halFileSeek(fp, offset, whence) fseek(fp, offset, whence)
#define halFileTell(fp)                 ftell(fp)
#define halFileFlush(fp)                fflush(fp)

int halFileExists(const char *filename)
{
    FILE *fp;
    fp=fopen(filename,"r");

    if(fp == NULL)
    {
        return 0;
    } else {
        fclose(fp);
        return 1;
    }
}

#include "../glue_file.h"